package com.uni.controller;

import cn.dustlight.captcha.annotations.CodeValue;
import cn.dustlight.captcha.annotations.SendCode;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * Author:      Unirithe/Mr.Chao
 * CSDN:        https://blog.csdn.net/Unirithe
 * CreatedTime:  2022/1/29 17:35
 **/
@RestController
public class CodeController {
    @RequestMapping("/captcha")
    @SendCode
    public void captcha(@CodeValue String code, HttpSession session) {
        session.setAttribute("code", code);
    }
}
